#pragma once

#include <AP_HAL/AP_HAL_Boards.h>
#include <AP_PiccoloCAN/AP_PiccoloCAN_config.h>

#ifndef HAL_GENERATOR_ENABLED
#define HAL_GENERATOR_ENABLED HAL_PROGRAM_SIZE_LIMIT_KB > 2048
#endif

#ifndef AP_GENERATOR_BACKEND_DEFAULT_ENABLED
#define AP_GENERATOR_BACKEND_DEFAULT_ENABLED HAL_GENERATOR_ENABLED
#endif

#ifndef AP_GENERATOR_IE_ENABLED
#define AP_GENERATOR_IE_ENABLED AP_GENERATOR_BACKEND_DEFAULT_ENABLED
#endif

#ifndef AP_GENERATOR_IE_2400_ENABLED
#define AP_GENERATOR_IE_2400_ENABLED AP_GENERATOR_BACKEND_DEFAULT_ENABLED && AP_GENERATOR_IE_ENABLED
#endif

#ifndef AP_GENERATOR_IE_650_800_ENABLED
#define AP_GENERATOR_IE_650_800_ENABLED AP_GENERATOR_BACKEND_DEFAULT_ENABLED && AP_GENERATOR_IE_ENABLED
#endif

#ifndef AP_GENERATOR_RICHENPOWER_ENABLED
#define AP_GENERATOR_RICHENPOWER_ENABLED AP_GENERATOR_BACKEND_DEFAULT_ENABLED && HAL_PROGRAM_SIZE_LIMIT_KB > 1024
#endif

#ifndef AP_GENERATOR_LOWEHEISER_ENABLED
#define AP_GENERATOR_LOWEHEISER_ENABLED AP_GENERATOR_BACKEND_DEFAULT_ENABLED && HAL_PROGRAM_SIZE_LIMIT_KB > 2048
#endif // AP_GENERATOR_LOWEHEISER_ENABLED

#ifndef AP_GENERATOR_CORTEX_ENABLED
#define AP_GENERATOR_CORTEX_ENABLED AP_GENERATOR_BACKEND_DEFAULT_ENABLED && HAL_PICCOLO_CAN_ENABLE && HAL_PROGRAM_SIZE_LIMIT_KB > 2048
#endif // AP_GENERATOR_CORTEX_ENABLED
